package com.newtouch.cq.base.starter.business.model.vo;

import java.io.Serializable;
import java.util.List;

public interface BaseParentAble<T extends BaseParentAble<?>> extends Serializable {

	Long getId();
	Long getParentId();
	void addChildEle(T child);
	List<T> getChildren();
	void initialChildren();
	
	default void addChild(T child) {
		if(null == child) {
			return;
		}
		if(null == getChildren()) {
			synchronized(this) {
				if(null == getChildren()) {
					initialChildren();
				}
			}
		}
		addChildEle(child);
	}

}
